using System.Collections.Generic;
using System.Xml.Linq;
using SharePointUtilitiesForDevelopers.Mapper;

namespace SharePointUtilitiesForDevelopers.Gateway
{
    /// <summary>
    /// Defines the interface for a gateway to the SharePoint Webs service.
    /// </summary>
    public interface ISharePointWebsServiceGateway
    {
        /// <summary>
        /// Gets the site columns in the specified site.
        /// </summary>
        /// <typeparam name="TDomainObject">The type of the domain object.</typeparam>
        /// <param name="siteUrl">The site URL.</param>
        /// <param name="mapper">The mapper.</param>
        /// <returns>A list of <see cref="TDomainObject"/> objects.</returns>
        IEnumerable<TDomainObject> GetSiteColumns<TDomainObject>(
            string siteUrl,
            IMapper<XElement, TDomainObject> mapper);

        /// <summary>
        /// Gets the specified content type.
        /// </summary>
        /// <typeparam name="TDomainObject">The type of the domain object.</typeparam>
        /// <param name="siteUrl">The site URL.</param>
        /// <param name="contentTypeId">The content type id.</param>
        /// <param name="mapper">The mapper.</param>
        /// <returns>A <see cref="TDomainObject"/>.</returns>
        TDomainObject GetContentType<TDomainObject>(
            string siteUrl, 
            string contentTypeId,
            IMapper<XElement, TDomainObject> mapper);

        /// <summary>
        /// Gets the content types.
        /// </summary>
        /// <typeparam name="TDomainObject">The type of the domain object.</typeparam>
        /// <param name="siteUrl">The site URL.</param>
        /// <param name="mapper">The mapper.</param>
        /// <returns>A list of <see cref="SharePointContentType"/> objects.</returns>
        IEnumerable<TDomainObject> GetContentTypes<TDomainObject>(
            string siteUrl,
            IMapper<XElement, TDomainObject> mapper);

        /// <summary>
        /// Gets the web.
        /// </summary>
        /// <typeparam name="TDomainObject">The type of the domain object.</typeparam>
        /// <param name="siteUrl">The site URL.</param>
        /// <param name="mapper">The mapper.</param>
        /// <returns>A <see cref="SharePointWeb"/>.</returns>
        TDomainObject GetWeb<TDomainObject>(
            string siteUrl,
            IMapper<XElement, TDomainObject> mapper);
    }
}